﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;

namespace AnaGiftedProject
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected SqlConnection ConnectToDatabase()
        {
            string CS = ConfigurationManager.ConnectionStrings["SqlServerCS"].ConnectionString;
            SqlConnection CN = new SqlConnection(CS);
            return CN;
        }
        protected void Page_Load(object sender, EventArgs e)
        {
           // string Qr;
           // Qr = "SELECT PRODUCT.PRODUCTID,PRODUCT.NAME,PRODUCT.PRICE,CATEGORY.CATID,CATEGORY.NAME FROM CATEGORY,PRODUCT WHERE CATEGORY.ID=PRODUCT.CATEGORYID";
            SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM FRIENDS", ConnectToDatabase());
            DataSet ds = new DataSet();
            da.Fill(ds, "Fr");
            GV1.DataSource = ds.Tables["Fr"];
            GV1.DataBind();

        }
    }
}